<h1>Registro encontrado</h1>    
<table>
  <thead>
    <!--<tr>
      <th>Id</th>
      <th>Nombre</th>
      <th>Descripcion</th>
    </tr> -->
    <?php if (count($aplicaciones) === 0):?>
       <td><h1>NO HAY NINGUN REGISTRO ASOCIADO</h1></td>
    <?php else:?>
    <tr>   
    <?php $total=0; ?>
    <?php foreach ($listas as $lis): ?>
      <th><?php echo $lis ?></th>
          <?php $total++; ?>
    <?php endforeach; ?>   
    </tr>
</thead> 
<tbody>
    <?php $pais='';$uni=''; ?>
    
    <!--    Solo captura valores   -->    
    <?php foreach ($aplicaciones as $beca): ?>
    <?php if($pais != $beca[5]){ ?>
       <?php $pais = $beca[5] ?> 
    
    <tr><td> <b><?php echo $pais?></b></td></tr>
    <?php }?>
    <?php if($uni != $beca[6]){ ?>
       <?php $uni = $beca[6] ?> 
    <tr><td></td><td><b><?php echo $uni?></b></td></tr>
    <?php }?>    
    <tr>
        <?php for($i=0; $i<$total; $i++){ ?>
            
            <td><?php echo $beca[$i] ?></td>
        <?php } ?>
    </tr>
    <?php endforeach; ?>

    
    <?php endif; ?>
  </tbody>
</table>